package com.yanfan.energy.domain;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author huan
 * @Description
 * @ClassName 2023年07月31日 14:24:00
 * @Version 1.0
 **/
public class TreeNode {

    private Long id;

    private String name;

    private Integer type;

    private List<TreeNode> children;

    public TreeNode(Long id, String name) {
        this.id = id;
        this.name = name;
        this.children = new ArrayList<>();
    }

    public TreeNode(Long id, String name, Integer type) {
        this.id = id;
        this.name = name;
        this.type = type;
        this.children = new ArrayList<>();
    }

    public void addChild(TreeNode child) {
        children.add(child);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<TreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
